cmake_minimum_required(VERSION 2.8)
project( PR_DETECTION )

set (OpenCV_DIR "/home/yjy/Software/opencv-2.4.13.6/build")

find_package( OpenCV REQUIRED )

set (source_dir "palmDemo/")
#set (include_dir "headers/")
set (source_ext ".cpp")
set (target_ext ".app")

#Release Debug
set(CMAKE_BUILD_TYPE Debug CACHE STRING "set build type to Debug")  

#/Od /Zi /arch /Og /Ot /Ox
list( APPEND CMAKE_CXX_FLAGS " -g ${CMAKE_CXX_FLAGS}")

#include_directories(${include_dir})
#add_subdirectory(include)

set(file_names 
    "main" )

#-----------------------target for main.app--------------------------
add_executable( main.app
    ${source_dir}main.cpp
    ${source_dir}palmdll.cpp
)
add_executable( test_roi.app
    ${source_dir}test_roi.cpp
    ${source_dir}palmdll.cpp
)
add_executable( check_success_rate.app
    ${source_dir}checkSuccessRate.cpp
    ${source_dir}palmdll.cpp
)
add_executable( theta_estimate.app
    ${source_dir}theta_estimate.cpp
    ${source_dir}palmdll.cpp
)
add_library( Zhangs_ancient_code
    ${source_dir}ZhangsFingerRootDetect.cpp
    ${source_dir}palmdll.cpp
)
#msvcrt
#target_link_libraries( main.app ${OpenCV_LIBS} pdcurses json11)
target_link_libraries( main.app ${OpenCV_LIBS})
target_link_libraries( test_roi.app ${OpenCV_LIBS})
target_link_libraries( check_success_rate.app ${OpenCV_LIBS})
target_link_libraries( theta_estimate.app ${OpenCV_LIBS})
target_link_libraries( Zhangs_ancient_code ${OpenCV_LIBS})